﻿using System.Web.UI;

namespace LootPoints.Security
{
    public class PageSecurity : Page
    {
        protected override void OnInit(System.EventArgs e)
        {
            base.OnInit(e);

            try { if ((bool)Session["logged"] != true) Response.Redirect("~/Pages/Login.aspx"); }
            catch { Response.Redirect("~/Pages/Login.aspx"); }
        }
    }

    public class AdminPageSecurity : PageSecurity
    {
        protected override void OnInit(System.EventArgs e)
        {
            base.OnInit(e);

            try { if ((bool)Session["isadmin"] != true) Response.Redirect("~/Pages/Overview.aspx"); }
            catch { Response.Redirect("~/Pages/Overview.aspx"); }
        }
    }
}